package com.lqd.mall.system;

import com.lqd.mall.basis.constant.ParamTypeConstants;
import com.lqd.mall.basis.response.CommonResult;
import com.lqd.mall.basis.response.Result;
import com.lqd.mall.interaction.basis.vo.TableDataInfoVo;
import com.lqd.mall.interaction.system.SysOperLogEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

/**
 * @author 零起点
 * @create 2022-03-02 22:23
 */
@RequestMapping("operlog")
@Api(tags = "操作日志操作")
public interface SysOperLogControllerApi {

    @PostMapping("save")
    @ApiOperation("内部保存日志操作")
    CommonResult save(@RequestBody SysOperLogEntity entity);

    @GetMapping("list")
    @ApiOperation("获取操作日志")
    Result<TableDataInfoVo<SysOperLogEntity>> list(SysOperLogEntity entity);


    @DeleteMapping("{operId}")
    @ApiOperation("删除操作日志")
    @ApiImplicitParam(name = "operId", value = "操作日志id", required = true, paramType = ParamTypeConstants.PATH)
    CommonResult deleteSysOperaLog(@PathVariable("operId") Long operId);

    @DeleteMapping("clean")
    @ApiOperation("删除全部操作日志")
    CommonResult cleanSysOperaLog();

    @PostMapping("export")
    @ApiOperation("导出日志")
    void exportSysOperaLog(HttpServletResponse response, SysOperLogEntity entity );
}
